import query from '@dfeidao/atom-nodejs/db/query';
import { systemid, productid } from '../atom/config';

interface Message {
	filter: {
		commodity_sale_no: string
	};
	page_no: number;
}

interface ICommoditySale { 	// 上架商品
	commodity_no: string;	// 商品编号
	commodity_sale_no: string;	// 上架商品编号
}
export default async function atom(msg: Message, action_id: string, session_id: string) {
	const { exec, prepare } = query(action_id, session_id, systemid);
	// commodity_sale_no

	prepare('product_information', ['commodity_no', 'category_num', 'category_name', 'commodity_thumbnails'], { productid }, 100, 1, [], []);
	const [commodity_sale] = await exec<ICommoditySale>();

	return commodity_sale;
}
